package com.supermarket.manage.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.supermarket.manage.common.validation.CheckGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 商品分类实体类
 *
 * @author: Faxon
 * @data: 2020/3/8
 */
@ApiModel(value = "ProductCategory:商品分类实体类")
@Data
@TableName("tb_product_category")
public class ProductCategory implements Serializable {

    private static final long serialVersionUID = -8417591642958699365L;
    /**
     * 分类主键
     */
    @ApiModelProperty(value = "分类主键")
    @TableId(type = IdType.ASSIGN_UUID)
    @NotBlank(message = "分类主键不能为空", groups = {CheckGroup.Update.class})
    private String cid;

    /**
     * 父id
     */
    @ApiModelProperty(value = "父id")
    @NotBlank(message = "父id不能为空", groups = {CheckGroup.Add.class, CheckGroup.Get.class})
    private String fid;

    /**
     * 分类名称
     */
    @ApiModelProperty(value = "分类名称")
    @NotBlank(message = "分类名称不能为空", groups = {CheckGroup.Add.class, CheckGroup.Update.class})
    private String cname;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @NotBlank(message = "客户id不能为空", groups = {CheckGroup.Add.class, CheckGroup.Update.class, CheckGroup.Get.class})
    private String buyerId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date created;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updated;
}
